package com.zlp.controller;
import com.zlp.utils.api.Result;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LiPing.Zou
 * @since 1.0.0
 */
@RestController
@RequestMapping("/user")
public class UserController {

	/**
	 * 获取用户信息
	 * @param authentication
	 * @date: 2021/3/29 17:15
	 * @return: Principal
	 */
	@GetMapping("/getCurrentUser")
	public Result<Object> getCurrentUser(Authentication authentication) {

		return Result.success(authentication.getPrincipal());
	}

}